package com.yugao.fintech.antelope.pay.payment.controller.bill;

import com.yugao.fintech.antelope.base.log.OperateLog;
import com.yugao.fintech.antelope.pay.common.service.BillService;
import com.yugao.fintech.antelope.pay.payment.model.rqrs.bill.BillQueryRQ;
import com.yugao.fintech.antelope.base.ram.ActionType;
import com.yugao.fintech.antelope.base.ram.RamResource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("/bill")
public class BillController {
    @Autowired
    private BillService billService;

    /**
     * 下载账单
     */
    @OperateLog(isSaveDb = false)
    @GetMapping("/download")
    @RamResource(action = "pay:bill:download", name = "下载账单", type = ActionType.READ)
    public void downloadBill(@RequestParam @Validated BillQueryRQ req) throws Exception {
        billService.downloadBill(req);
    }
}
